<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>icixi便签</title>
<link  href="css.css" rel="stylesheet" type="text/css"> 
</head>
<body>
  <ul>
<?php      
$con = mysqli_connect('127.0.0.1','xyq','MYPespMKX','xyq');//IP地址，用户名，密码，数据库名。
if (!$con) {
    die('Could not connect: ' . mysqli_error($con));
}

$sql="SELECT title,left(content,100) content,link FROM notes order by myorder desc,id desc limit 0,18";//myorder 列的数据越大，排序越前。
$result = mysqli_query($con,$sql); 
while($row = mysqli_fetch_array($result)) {
    echo '<li><a href="'.htmlspecialchars($row['link']).'">';
    echo '<h2>'.htmlspecialchars($row['title']).'</h2><p>'.htmlspecialchars($row['content']).'</p></a></li>';
}
?>
  </ul>
</body>
</html>